﻿// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");

var products = new List<Product>
 {
    new Product { Name = "Laptop", Price = 999.99m, Description = "A high-performance laptop.", Category = "Electronics", IsInStock = true },
    new Product { Name = "Smartphone", Price = 699.99m, Description = "A latest model smartphone.", Category = "Electronics", IsInStock = true },
    new Product { Name = "Desk Chair", Price = 89.99m, Description = "An ergonomic desk chair.", Category = "Furniture", IsInStock = false },
    new Product { Name = "Coffee Maker", Price = 49.99m, Description = "A programmable coffee maker.", Category = "Appliances", IsInStock = true },
    new Product { Name = "Headphones", Price = 199.99m, Description = "Noise-cancelling headphones.", Category = "Electronics", IsInStock = true },
    new Product { Name = "Electric Kettle", Price = 29.99m, Description = "A fast-boiling electric kettle.", Category = "Appliances", IsInStock = false },
    new Product { Name = "Bookshelf", Price = 59.99m, Description = "A wooden bookshelf.", Category = "Furniture", IsInStock = true },
    new Product { Name = "Tablet", Price = 399.99m, Description = "A lightweight tablet device.", Category = "Electronics", IsInStock = true },
    new Product { Name = "Blender", Price = 79.99m, Description = "A high-speed blender.", Category = "Appliances", IsInStock = true, },
    new Product { Name = "Office Desk", Price = 149.99m, Description = "A spacious office desk.", Category ="Furniture", IsInStock=true }
 };

var filter = DynamicFilterBuilder.BuildDynamicFilter(
    nameContains: "e",
    minPrice: 50m,
    maxPrice: 200m,
    category: "Electronics",
    isInStock: true);

var filteredProducts = products.AsQueryable().Where(filter).ToList();
foreach (var product in filteredProducts)
{
    Console.WriteLine($"{product.Name} - {product.Price:C} - {product.Category} - In Stock: {product.IsInStock}");
}